﻿using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using Inaction.Core;
using Inaction.Mapping;

namespace Inaction.Business.Security.Abstract
{
    [Table("Assembly"), DisplayName("程序集"), Serializable]
    public abstract class Assembly<T> : Inaction.Business.Entity<T> where T : Assembly<T>, new()
    {
        #region 属性

        public static readonly Property<Guid?> IdProperty = RegisteProperty<Guid?>(p => p.Id);
        Guid? _id;
        [Column("Id"), DisplayName("程序集"), Display(Description = "程序集")]
        public Guid? Id
        {
            get { return _id; }
            internal set { SetProperty(IdProperty, ref _id, value); }
        }

        public static readonly Property<String> NameProperty = RegisteProperty<String>(p => p.Name);
        String _name;
        [Column("Name"), DisplayName("名称"), Display(Description = "名称")]
        public String Name
        {
            get { return _name; }
            set { SetProperty(NameProperty, ref _name, value); }
        }

        public static readonly Property<String> DescriptionProperty = RegisteProperty<String>(p => p.Description);
        String _description;
        [Column("Description"), DisplayName("说明"), Display(Description = "说明")]
        public String Description
        {
            get { return _description; }
            set { SetProperty(DescriptionProperty, ref _description, value); }
        }


        public static readonly Property<String> CreaterProperty = RegisteProperty<String>(p => p.Creater);
        String _creater;
        [Column("Creater"), DisplayName("创建人"), Display(Description = "创建人"), Browsable(false)]
        public String Creater
        {
            get { return _creater; }
        }

        public static readonly Property<DateTime?> CreateTimeProperty = RegisteProperty<DateTime?>(p => p.CreateTime);
        DateTime? _createTime;
        [Column("CreateTime"), DisplayName("创建时间"), Display(Description = "创建时间"), Browsable(false)]
        public DateTime? CreateTime
        {
            get { return _createTime; }
        }

        public static readonly Property<String> UpdaterProperty = RegisteProperty<String>(p => p.Updater);
        String _updater;
        [Column("Updater"), DisplayName("修改人"), Display(Description = "修改人"), Browsable(false)]
        public String Updater
        {
            get { return _updater; }
        }

        public static readonly Property<DateTime?> UpdateTimeProperty = RegisteProperty<DateTime?>(p => p.UpdateTime);
        DateTime? _updateTime;
        [Column("UpdateTime"), DisplayName("修改时间"), Display(Description = "修改时间"), Browsable(false)]
        public DateTime? UpdateTime
        {
            get { return _updateTime; }
        }

        #endregion
    }
}
